package com.cloudcc.cloudframe.net.async;

import com.cloudcc.cloudframe.net.ErrorInfo;
import com.cloudcc.cloudframe.net.RequestListener;
import com.google.gson.JsonObject;
import com.litesuits.android.log.Log;

/**
 * @Description: 返回jsonobject 对象的请求
 * @author wangzhiqiang
 * @date 2015-11-30 下午3:16:32
 * 
 */
public class JsonObjectRequest extends JsonRequest {

	private RequestListener l;

	@Override
	public void handleSuccess(JsonObject json, String resp) {
		Log.d("RequestListener", "JsonObjectRequest" + json);
		if (l != null) {
			l.onSuccess(json);
		}
	}

	@Override
	public void handleFailure(ErrorInfo e) {
		Log.d("RequestListener", "失败：JsonObjectRequest" + e);
		if (l != null) {
			l.onFailure(e);
		}
	}

	public RequestListener getRequestListener() {
		return l;
	}

	public void setRequestListener(RequestListener l) {
		this.l = l;
	}

}
